

import AutomaticRecode from "../../Commons/AutomaticRecode";

export default class ShopEntity extends AutomaticRecode {
    id: number;
    endTime: number;
    buyTimes: number;

    constructor(value: any) {
        super();
        this.init(value);
    }

    get leftTime(): number {
        var nowTime = cc.sys.now();
        if (nowTime < this.endTime * 1000) {
            return this.endTime * 1000 - nowTime;
        } else {
            return 0;
        }
    }
}
